<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>

<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<head />
<body bgcolor="white">
Provides an HBase <a href="http://thrift.apache.org/">Thrift</a>
service.

This package contains a Thrift interface definition file for an HBase RPC
service and a Java server implementation.

There are currently 2 thrift server implementations in HBase, the packages:

<ul>
  <li>org.apache.hadoop.hbase.thrift: This may one day be marked as depreceated.</li>
  <li>org.apache.hadoop.hbase.thrift2: i.e. this package. This is intended to closely match to the HTable interface and
  to one day supercede the older thrift (the old thrift mimics an API HBase no longer has).</li>
</ul>

<h2><a name="whatisthrift">What is Thrift?</a></h2>


<p>"Thrift is a software framework for scalable cross-language services
development. It combines a software stack with a code generation engine to
build services that work efficiently and seamlessly between C++, Java, Python,
PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk,
and OCaml. Originally developed at Facebook, Thrift was open sourced in April
2007 and entered the Apache Incubator in May, 2008".
From http://thrift.apache.org/</p>

<h2><a name="description">Description</a></h2>

<p>The HBase API is defined in the
file hbase.thrift. A server-side implementation of the API is in
<code>org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandler</code> with the
server boiler plate in <code>org.apache.hadoop.hbase.thrift2.ThriftServer</code>.
The generated interfaces, types, and RPC utility files are checked into SVN under the
<code>org.apache.hadoop.hbase.thrift2.generated</code> directory.
</p>
<p>To stop, use:
<pre>
  ./bin/hbase-daemon.sh stop thrift2
</pre>

These are the command line arguments the Thrift server understands in addition to <code>start</code> and <code>stop</code>:
<dl>
    <dt><code>-b, --bind</code></dt>
    <dd>Address to bind the Thrift server to. Not supported by the Nonblocking and HsHa server [default: <code>0.0.0.0</code>]</dd>

    <dt><code>-p, --port</code></dt>
    <dd>Port to bind to [default: <code>9090</code>]</dd>

    <dt><code>-f, --framed</code></dt>
    <dd>Use framed transport (implied when using one of the non-blocking servers)</dd>

    <dt><code>-c, --compact</code></dt>
    <dd>Use the compact protocol [default: binary protocol]</dd>

    <dt><code>-h, --help</code></dt>
    <dd>Displays usage information for the Thrift server</dd>

    <dt><code>-threadpool</code></dt>
    <dd>Use the TThreadPoolServer. This is the default.</dd>

    <dt><code>-hsha</code></dt>
    <dd>Use the THsHaServer. This implies the framed transport.</dd>

    <dt><code>-nonblocking</code></dt>
    <dd>Use the TNonblockingServer. This implies the framed transport.</dd>
</dl>

<h3><a name="details">Details</a></h3>

<p>HBase currently uses version 0.9.0 of Apache Thrift.</p>
<p>The files were generated by running the commands under the hbase checkout dir:
<pre>
  mvn compile -Pcompile-thrift
</pre>

<p>The 'thrift' binary is the Thrift compiler, and it is distributed separately from HBase
in a Thrift release. Additionally, specific language runtime libraries are a
part of a Thrift release. A version of the Java runtime is included in HBase via maven.
</p>

</body>
</html>
